package com.espirit.weixin.common;

import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonProperty;

public class Button {

	public static final String BUTTON_TYPE_CLICK = "click";

	public static final String BUTTON_TYPE_VIEW = "view";

	private String name;

	private String type;

	private String key;
	
	private String url;

	@JsonProperty("sub_button")
	private List<Button> subButtons;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Button> getSubButtons() {
		return subButtons;
	}

	public void setSubButtons(List<Button> subButtons) {
		this.subButtons = subButtons;
	}

	public void addSubButton(Button button) {
		if (this.subButtons == null) {
			this.subButtons = new ArrayList<>(10);
		}
		this.subButtons.add(button);
	}
}
